package com.lanqiao.service.impl;

import com.lanqiao.mapper.UserMapper;
import com.lanqiao.service.IUserService;
import com.lanqiao.vo.UsersInfo;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2018/10/4.
 */
@Service("userService")
public class UserServiceImpl implements IUserService {

    static Logger logger = Logger.getLogger(UserServiceImpl.class);

    @Resource
    private UserMapper userMapper;

    @Override
    public UsersInfo login(UsersInfo user) {
        return userMapper.login(user);
    }

    @Override
    public int insert(UsersInfo user) {
        int row = userMapper.regist(user);
        logger.debug("数据插入已完成。");
       /* if (row==1) {
            throw new IllegalArgumentException("出现异常，事务回滚");
        }*/
        return row;
    }
}
